//*************************************************************************************
//* 作    者： z hunter
//* 创建时间： 2021-11-29 04:12:33
//* 描    述： 多语言注册

//* ************************************************************************************
using UnityEngine;

public class RegistLocalization4Command : UFrame.ICommand<int>
{
    public void Execute(int observeKey)
    {
        var localizationCfg = TableAgent.Instance.localization_cfgTable;
        using (var enumerator = localizationCfg.GetListEnumerator())
        {
            while (enumerator.MoveNext())
            {
                var current = enumerator.Current;
                LanguageAgent.Instance.MakeKeyIndex(current.key, current.id);
                LanguageAgent.Instance.SetText(current.ID, current.cn, (int)SystemLanguage.Chinese);
                LanguageAgent.Instance.SetText(current.ID, current.en, (int)SystemLanguage.English);
                LanguageAgent.Instance.SetText(current.ID, current.jp, (int)SystemLanguage.Japanese);
                LanguageAgent.Instance.SetText(current.ID, current.tw, (int)SystemLanguage.ChineseTraditional);
            }
        }
        localizationCfg.Clear();
    }
}
